<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>订单管理 - TMS</title>
    <link rel="stylesheet" href="/view/frame/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/view/frame/static/css/global.css?v=1.0">
    <style>
      body {margin:20px;}
      span.required {color:#f00; font-family:'simsun', '宋体'; margin-right:5px; font-size:15px;}
      .form-txt {margin:-10px 0 20px 110px; color:#999; font-size:13px;}
    </style>
  </head>
  <body>
    <form class="layui-form" method="post" autocomplete="off">
      <div class="layui-form-item">
        <label class="layui-form-label"><span class="required">*</span>角色名称</label>
        <div class="layui-input-block">
          <input type="text" name="name" lay-verify="name" placeholder="请输入角色名称" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item" pane="" id="platformBox">
        <label class="layui-form-label"><span class="required">*</span>所属系统</label>
        <div class="layui-input-block" id="platformId"></div>
      </div>
      <div class="form-txt">注：当你选择多个系统时，将为每个系统生成一个同样角色名字的角色</div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
          <textarea name="remarks" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn layui-btn-normal" lay-submit lay-filter="submit">保存</button>
          <button class="layui-btn layui-btn-primary" type="reset">重置</button>
        </div>
      </div>
    </form>
  </body>
  <script charset="utf-8" src="/view/frame/layui/layui.js"></script>
  <script charset="utf-8" src="/view/frame/static/js/jquery.min.js?v=1.0"></script>
  <script charset="utf-8" src="/view/tms/static/js/tms_index.js?v=1219"></script>
  
  <script charset="utf-8" src="/view/frame/static/js/errorCodeMap.js"></script>
  <script charset="utf-8" src="/view/frame/static/js/HC.js?v=1.4"></script>
  <script charset="utf-8" src="/view/tms/static/js/validator.js"></script>
  <script charset="utf-8" src="/view/tms/static/js/bizUtil.js"></script>
  
  <script>
    var $id = $.trim(getUrlParam('id'));
    if($id == null || $id == ''){
      layui.use('layer', function(){
        parent.layer.alert('非法参数！', {
          yes: function(){
            parent.layer.closeAll();
          }
        });
      });
    }

    var $type = $.trim(getUrlParam('do'));
    layui.use(['form', 'layer'], function(){
      var form = layui.form,
          layer = layui.layer,
          $ = layui.jquery;

      //自定义验证规则
      form.verify({
        
      });


      if($type == 'edit'){
        //todo
      }
      
      //监听提交
      form.on('submit(submit)', function(data){
        //todo

        parent.layer.closeAll();
        //获取当前框架ID
        var $layId = $(window.parent.document).find('.layui-this').attr('lay-id');
        parent['f' + $layId].location.reload();
      });
    });
  </script>
</html>